package com.lkj;

import cn.hutool.core.codec.Base64;
import cn.hutool.core.swing.clipboard.ClipboardUtil;

import java.io.File;
import java.io.IOException;

public class ImageUtil {

    public static String getImage() {

        File file = new File("F:\\java\\gather\\baidu-face\\iamges\\lkj.jpg");

        String encode = Base64.encode(file);

        ClipboardUtil.setStr(encode);

        return encode;
    }

    public static String getImage(String fileName){

        String filePath = "F:\\java\\gather\\baidu-face\\iamges\\"+fileName;

        File file = new File(filePath);

        String encode = Base64.encode(file);

        ClipboardUtil.setStr(encode);

        return encode;
    }
}
